#include<iostream>
#include "polynomial.h"
#include "vector"
#include <cmath>  
using namespace std;

class Func2 : public Function {
    public:
        virtual double operator()(const double &x)const {
            return 1.0 / (1.0 + 25*x * x);
        }
}Func2;

int main(){
    Polynomial p_5 = Chebyshev_Interpolation(Func2, -1, 1, 6).getPoly();
    Polynomial p_10 = Chebyshev_Interpolation(Func2, -1, 1, 11).getPoly();
    Polynomial p_15 = Chebyshev_Interpolation(Func2, -1, 1, 16).getPoly();
    Polynomial p_20 = Chebyshev_Interpolation(Func2, -1, 1, 21).getPoly();
    cout << "n = 5: " << p_5 << endl;
    cout << "n = 10: "<< p_10 << endl;
    cout << "n = 15: "<< p_15 << endl;
    cout << "n = 20: "<< p_20 << endl;
    return 0;
}